import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/get_realtime_person_monitoring_entity.dart';

GetRealtimePersonMonitoringEntity $GetRealtimePersonMonitoringEntityFromJson(Map<String, dynamic> json) {
  final GetRealtimePersonMonitoringEntity getRealtimePersonMonitoringEntity = GetRealtimePersonMonitoringEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    getRealtimePersonMonitoringEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    getRealtimePersonMonitoringEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    getRealtimePersonMonitoringEntity.companyName = companyName;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    getRealtimePersonMonitoringEntity.name = name;
  }
  final int? sex = jsonConvert.convert<int>(json['sex']);
  if (sex != null) {
    getRealtimePersonMonitoringEntity.sex = sex;
  }
  final String? sexStr = jsonConvert.convert<String>(json['sexStr']);
  if (sexStr != null) {
    getRealtimePersonMonitoringEntity.sexStr = sexStr;
  }
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    getRealtimePersonMonitoringEntity.phone = phone;
  }
  final String? idCard = jsonConvert.convert<String>(json['idCard']);
  if (idCard != null) {
    getRealtimePersonMonitoringEntity.idCard = idCard;
  }
  final String? groupId = jsonConvert.convert<String>(json['groupId']);
  if (groupId != null) {
    getRealtimePersonMonitoringEntity.groupId = groupId;
  }
  final int? craft = jsonConvert.convert<int>(json['craft']);
  if (craft != null) {
    getRealtimePersonMonitoringEntity.craft = craft;
  }
  final String? craftStr = jsonConvert.convert<String>(json['craftStr']);
  if (craftStr != null) {
    getRealtimePersonMonitoringEntity.craftStr = craftStr;
  }
  final String? enterTime = jsonConvert.convert<String>(json['enterTime']);
  if (enterTime != null) {
    getRealtimePersonMonitoringEntity.enterTime = enterTime;
  }
  final String? exitTime = jsonConvert.convert<String>(json['exitTime']);
  if (exitTime != null) {
    getRealtimePersonMonitoringEntity.exitTime = exitTime;
  }
  final GetRealtimePersonMonitoringTrajectory? trajectory = jsonConvert.convert<GetRealtimePersonMonitoringTrajectory>(json['trajectory']);
  if (trajectory != null) {
    getRealtimePersonMonitoringEntity.trajectory = trajectory;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    getRealtimePersonMonitoringEntity.createTime = createTime;
  }
  final List<GetRealtimePersonMonitoringPersonLocationDataDO>? personLocationDataDO = (json['personLocationDataDO'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GetRealtimePersonMonitoringPersonLocationDataDO>(e) as GetRealtimePersonMonitoringPersonLocationDataDO).toList();
  if (personLocationDataDO != null) {
    getRealtimePersonMonitoringEntity.personLocationDataDO = personLocationDataDO;
  }
  return getRealtimePersonMonitoringEntity;
}

Map<String, dynamic> $GetRealtimePersonMonitoringEntityToJson(GetRealtimePersonMonitoringEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['name'] = entity.name;
  data['sex'] = entity.sex;
  data['sexStr'] = entity.sexStr;
  data['phone'] = entity.phone;
  data['idCard'] = entity.idCard;
  data['groupId'] = entity.groupId;
  data['craft'] = entity.craft;
  data['craftStr'] = entity.craftStr;
  data['enterTime'] = entity.enterTime;
  data['exitTime'] = entity.exitTime;
  data['trajectory'] = entity.trajectory.toJson();
  data['createTime'] = entity.createTime;
  data['personLocationDataDO'] = entity.personLocationDataDO.map((v) => v.toJson()).toList();
  return data;
}

extension GetRealtimePersonMonitoringEntityExtension on GetRealtimePersonMonitoringEntity {
  GetRealtimePersonMonitoringEntity copyWith({
    int? id,
    int? companyId,
    String? companyName,
    String? name,
    int? sex,
    String? sexStr,
    String? phone,
    String? idCard,
    String? groupId,
    int? craft,
    String? craftStr,
    String? enterTime,
    String? exitTime,
    GetRealtimePersonMonitoringTrajectory? trajectory,
    String? createTime,
    List<GetRealtimePersonMonitoringPersonLocationDataDO>? personLocationDataDO,
  }) {
    return GetRealtimePersonMonitoringEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..name = name ?? this.name
      ..sex = sex ?? this.sex
      ..sexStr = sexStr ?? this.sexStr
      ..phone = phone ?? this.phone
      ..idCard = idCard ?? this.idCard
      ..groupId = groupId ?? this.groupId
      ..craft = craft ?? this.craft
      ..craftStr = craftStr ?? this.craftStr
      ..enterTime = enterTime ?? this.enterTime
      ..exitTime = exitTime ?? this.exitTime
      ..trajectory = trajectory ?? this.trajectory
      ..createTime = createTime ?? this.createTime
      ..personLocationDataDO = personLocationDataDO ?? this.personLocationDataDO;
  }
}

GetRealtimePersonMonitoringTrajectory $GetRealtimePersonMonitoringTrajectoryFromJson(Map<String, dynamic> json) {
  final GetRealtimePersonMonitoringTrajectory getRealtimePersonMonitoringTrajectory = GetRealtimePersonMonitoringTrajectory();
  return getRealtimePersonMonitoringTrajectory;
}

Map<String, dynamic> $GetRealtimePersonMonitoringTrajectoryToJson(GetRealtimePersonMonitoringTrajectory entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension GetRealtimePersonMonitoringTrajectoryExtension on GetRealtimePersonMonitoringTrajectory {
}

GetRealtimePersonMonitoringPersonLocationDataDO $GetRealtimePersonMonitoringPersonLocationDataDOFromJson(Map<String, dynamic> json) {
  final GetRealtimePersonMonitoringPersonLocationDataDO getRealtimePersonMonitoringPersonLocationDataDO = GetRealtimePersonMonitoringPersonLocationDataDO();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.createTime = createTime;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.updateTime = updateTime;
  }
  final String? creator = jsonConvert.convert<String>(json['creator']);
  if (creator != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.creator = creator;
  }
  final String? updater = jsonConvert.convert<String>(json['updater']);
  if (updater != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.updater = updater;
  }
  final bool? deleted = jsonConvert.convert<bool>(json['deleted']);
  if (deleted != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.deleted = deleted;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.companyName = companyName;
  }
  final String? cardId = jsonConvert.convert<String>(json['cardId']);
  if (cardId != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.cardId = cardId;
  }
  final String? stationId = jsonConvert.convert<String>(json['stationId']);
  if (stationId != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.stationId = stationId;
  }
  final String? stationName = jsonConvert.convert<String>(json['stationName']);
  if (stationName != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.stationName = stationName;
  }
  final String? locationX = jsonConvert.convert<String>(json['locationX']);
  if (locationX != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.locationX = locationX;
  }
  final String? locationY = jsonConvert.convert<String>(json['locationY']);
  if (locationY != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.locationY = locationY;
  }
  final String? locationZ = jsonConvert.convert<String>(json['locationZ']);
  if (locationZ != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.locationZ = locationZ;
  }
  final String? locationUpdateTime = jsonConvert.convert<String>(json['locationUpdateTime']);
  if (locationUpdateTime != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.locationUpdateTime = locationUpdateTime;
  }
  final String? locationAerial = jsonConvert.convert<String>(json['locationAerial']);
  if (locationAerial != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.locationAerial = locationAerial;
  }
  final GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO? personTrackDO = jsonConvert.convert<GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO>(json['personTrackDO']);
  if (personTrackDO != null) {
    getRealtimePersonMonitoringPersonLocationDataDO.personTrackDO = personTrackDO;
  }
  return getRealtimePersonMonitoringPersonLocationDataDO;
}

Map<String, dynamic> $GetRealtimePersonMonitoringPersonLocationDataDOToJson(GetRealtimePersonMonitoringPersonLocationDataDO entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['creator'] = entity.creator;
  data['updater'] = entity.updater;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['cardId'] = entity.cardId;
  data['stationId'] = entity.stationId;
  data['stationName'] = entity.stationName;
  data['locationX'] = entity.locationX;
  data['locationY'] = entity.locationY;
  data['locationZ'] = entity.locationZ;
  data['locationUpdateTime'] = entity.locationUpdateTime;
  data['locationAerial'] = entity.locationAerial;
  data['personTrackDO'] = entity.personTrackDO.toJson();
  return data;
}

extension GetRealtimePersonMonitoringPersonLocationDataDOExtension on GetRealtimePersonMonitoringPersonLocationDataDO {
  GetRealtimePersonMonitoringPersonLocationDataDO copyWith({
    String? createTime,
    String? updateTime,
    String? creator,
    String? updater,
    bool? deleted,
    int? id,
    int? companyId,
    String? companyName,
    String? cardId,
    String? stationId,
    String? stationName,
    String? locationX,
    String? locationY,
    String? locationZ,
    String? locationUpdateTime,
    String? locationAerial,
    GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO? personTrackDO,
  }) {
    return GetRealtimePersonMonitoringPersonLocationDataDO()
      ..createTime = createTime ?? this.createTime
      ..updateTime = updateTime ?? this.updateTime
      ..creator = creator ?? this.creator
      ..updater = updater ?? this.updater
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..cardId = cardId ?? this.cardId
      ..stationId = stationId ?? this.stationId
      ..stationName = stationName ?? this.stationName
      ..locationX = locationX ?? this.locationX
      ..locationY = locationY ?? this.locationY
      ..locationZ = locationZ ?? this.locationZ
      ..locationUpdateTime = locationUpdateTime ?? this.locationUpdateTime
      ..locationAerial = locationAerial ?? this.locationAerial
      ..personTrackDO = personTrackDO ?? this.personTrackDO;
  }
}

GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO $GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDOFromJson(Map<String, dynamic> json) {
  final GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO = GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.createTime = createTime;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.updateTime = updateTime;
  }
  final String? creator = jsonConvert.convert<String>(json['creator']);
  if (creator != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.creator = creator;
  }
  final String? updater = jsonConvert.convert<String>(json['updater']);
  if (updater != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.updater = updater;
  }
  final bool? deleted = jsonConvert.convert<bool>(json['deleted']);
  if (deleted != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.deleted = deleted;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.companyId = companyId;
  }
  final String? locationAerial = jsonConvert.convert<String>(json['locationAerial']);
  if (locationAerial != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.locationAerial = locationAerial;
  }
  final double? longitude = jsonConvert.convert<double>(json['longitude']);
  if (longitude != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.longitude = longitude;
  }
  final double? latitude = jsonConvert.convert<double>(json['latitude']);
  if (latitude != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.latitude = latitude;
  }
  final int? height = jsonConvert.convert<int>(json['height']);
  if (height != null) {
    getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO.height = height;
  }
  return getRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO;
}

Map<String, dynamic> $GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDOToJson(GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['creator'] = entity.creator;
  data['updater'] = entity.updater;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['locationAerial'] = entity.locationAerial;
  data['longitude'] = entity.longitude;
  data['latitude'] = entity.latitude;
  data['height'] = entity.height;
  return data;
}

extension GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDOExtension on GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO {
  GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO copyWith({
    String? createTime,
    String? updateTime,
    String? creator,
    String? updater,
    bool? deleted,
    int? id,
    int? companyId,
    String? locationAerial,
    double? longitude,
    double? latitude,
    int? height,
  }) {
    return GetRealtimePersonMonitoringPersonLocationDataDOPersonTrackDO()
      ..createTime = createTime ?? this.createTime
      ..updateTime = updateTime ?? this.updateTime
      ..creator = creator ?? this.creator
      ..updater = updater ?? this.updater
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..locationAerial = locationAerial ?? this.locationAerial
      ..longitude = longitude ?? this.longitude
      ..latitude = latitude ?? this.latitude
      ..height = height ?? this.height;
  }
}